<?php
/**
 * @version		$Id: banner.php 10878 2008-08-30 17:29:13Z willebil $
 * @package		Joomla
 * @subpackage	Banners
 * @copyright	Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
 * @license		GNU/GPL, see LICENSE.php
 * Joomla! is free software. This version may have been modified pursuant
 * to the GNU General Public License, and as distributed it includes or
 * is derivative of works licensed under the GNU General Public License or
 * other free or open source software licenses.
 * See COPYRIGHT.php for copyright notices and details.
 */

// no direct access
defined ( '_JEXEC' ) or die ( 'Restricted access' );
jimport ( 'joomla.application.component.controller' );


class ManagerControllerImport extends JController {

	var $urldirect  = "";
	var $mainframe = "";
	
    function __construct() {
        parent::__construct ();
        
        $this->view = &	$this->getView( 'import', 'html' );
        $this->urldirect = 'index.php?option=com_manager&c=import';
        $this->mainframe = JFactory::getApplication();
    }

    function display() {
        $this->view->display();
    }

    function save() {
    	$model_import = JModel::getInstance('Import', 'PimModel');
    	
    	if (isset($_POST['btn_import_serial']) && isset($_FILES['import_serial'])) {
    		$result = $model_import->importSerial($_FILES['import_serial']['tmp_name']);
    	}
    	
    	if (isset($_POST['btn_import_product']) && isset($_FILES['import_product'])) {
    		$result = $model_import->importProduct($_FILES['import_product']['tmp_name']);
    	}
    	
    	$this->view->assign('status_import', $result);
    	$this->view->display();
    }
}

?>